<p>
  <b>Login:</b> <%=h @user.login %>
</p>
 
<p>
  <b>Login count:</b>  <%=h @user.login_count %>
</p>
 
<p>
  <b>Last request at:</b>  <%=h @user.last_request_at %>
</p>
 
<p>
  <b>Last login at:</b>  <%=h @user.last_login_at %>
</p>
 
<p>
  <b>Current login at:</b>  <%=h @user.current_login_at %>
</p>
 
<p>
  <b>Last login ip:</b>  <%=h @user.last_login_ip %>
</p>
 
<p>
  <b>Current login ip:</b>  <%=h @user.current_login_ip %>
</p>
<p>
  <b>Current role:</b> <%=h @user.role %>
</p>
<% if can? :read, Comment%>
	<% unless @user.comments.empty? %>
		<h2><%= pluralize(@user.comments.size, 'comment') %></h2>

		<div id="comments">
			<% for comment in @user.comments %>
				<div class="comment">
					<strong><%= h(comment.title)%> </strong>form<strong><i> <%= h(comment.user ?  comment.user.login : "none") %></i></strong>
					<em>on <%= comment.created_at.strftime('%b %d, %Y at %H:%M') %></em>
					<%=simple_format comment.comment %>
					<p>
					<% if can? :update, comment %>
						<%= link_to "Edit", edit_user_comment_path(@user,comment) %>
					<% end %>
					<% if can? :destroy, comment %>
						| <%= link_to "Destroy", user_comment_path(@user,comment), :method => :delete, :confirm => "Are you sure?" %>
					<% end %>
					</p>
				</div>
			<% end %>
		</div>
	<% end %>

	<h3>Add your comment:</h3>
	<% if can? :create, Comment%>
		<%= render :partial => 'comments/form' %>
	<%end%>
<%end%>

<% if can? :update, @user%>
	<%= link_to 'Edit', edit_user_path(@user) %>
<%end%>
<%= link_to 'Student list', users_path %>
